/**
 * Developed by PuzzleDev s.n.c.
 * 2012 all rights reserved.
 * www.puzzledev.com
 */
package it.polimi.nuzot.core

import org.junit._
import Assert._

/**
 * @author Michele Sama (m.sama@puzzledev.com)
 *
 * Test case for the DSLInterpreter class
 */
class DSLInterpreterTestCase {

    @Test
    def testSetParamValues(): Unit = {
        class MockInterpreter extends DSLInterpreter {
        	_params = Map(
            	"foo" -> ExecutionParam(
                    "foo",
            		true,
            		"The foo."),
            	"bar" -> ExecutionParam(
                    "bar",
            		true,
            		"The bar."))
        }
        
        val interpreter = new MockInterpreter()
        var args = Array[String]("bar", "foo=5", "asd", "lol=345")
        
        interpreter.params(args)
        
        val expected = Map("bar" -> "bar", "foo" -> "5")
        assertEquals(2, interpreter.params().size)
    }
}